/**
 * 
 */
package com.gragra.wilsHandler;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import com.gragra.sampling.sequentialStructure.ExtensionLevels;
import com.gragra.sampling.sequentialStructure.WordAndTagHolder;
import com.gragra.sequentiaDataGenerator.BaseGenerator;
import com.gragra.sequentiaDataGenerator.EmptySegmentation;
import com.gragra.util.StringToInt;
/**
 * @author Christoph Teichmann
 * 25.09.2013
 */
public class ReplaceWithContextTags 
{
	/**
	 * @param args
	 */
	public static void main(String[] args) throws IOException
	{
		BufferedReader from = new BufferedReader(new FileReader(args[0]));
		BufferedWriter to = new BufferedWriter(new FileWriter(args[1]));
		BaseGenerator bg = new BaseGenerator(new EmptySegmentation());
		String line;
		while((line = from.readLine()) != null)
		{
			WordAndTagHolder wth = bg.transferSingle(line);
			for(int i=0;i<wth.getLength();++i)
			{wth.getTags()[i] = StringToInt.ensure(Integer.toString(wth.getExtensionInformation().getInfiniteInformation(i, ExtensionLevels.ContextTagLevel)));}
		}
		from.close();
		to.close();
	}
}